import React from 'react'
import {withRouter} from 'react-router-dom'
import {connect} from 'react-redux'
import {MapStateToPropsParam} from 'react-redux'

function connectComponent(
  mapStateToProps: MapStateToPropsParam<any, any, any>,
  actions: any,
  component: React.ComponentClass | React.FC<any>,
): any {
  return withRouter(connect(mapStateToProps, actions, null, {pure: true})(component))
}

export {connectComponent}
